package com.own.business.system.menu.mapper;

import com.own.business.system.menu.entity.map.SystemMenuMapVo;
import com.own.business.system.menu.entity.po.SystemMenu;
import com.own.business.system.menu.entity.query.SystemMenuQuery;
import com.own.business.system.menu.entity.vo.SystemMenuVo;
import com.own.component.common.base.mapper.BasePageMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * SystemMenuMapper
 *
 * @author chenxueli
 * @date 2024-03-31 09:22:58
 */
@Mapper
public interface SystemMenuMapper extends BasePageMapper<
        SystemMenu,
        SystemMenuVo,
        SystemMenuMapVo,
        SystemMenuQuery
        > {

    /**
     * 根据id更新排序
     *
     * @param id   id
     * @param sort 排序
     * @return 更新数量
     */
    @Update("update own_system_menu set sort_order = #{sort} where id = #{id}")
    int updateSortById(@Param("id") Long id, @Param("sort") Integer sort);

}
